import { HashRouter,BrowserRouter,Route,Routes,Link,useRoutes } from "react-router-dom";
import { Provider } from "react-redux";
import store from "@/store/index"
// import Layout from "@/pages/layout/index.jsx"
// import Login from "@/pages/login/index.jsx"
import Dashboard from "@/pages/dashboard/index"
import Good from "@/pages/good/goodList"
import User from "@/pages/user/index"
import { func } from "prop-types";
import { asyncRoutes } from "@/pages/index.jsx";
import Page from "./Permission";

function createRoutes(accessRoutes){
    let result=[];
    accessRoutes.forEach(route=>{
        if(route.path&&route.element){
          result.push(
            <Route key={route.key} path={route.path} element={route.element}></Route>
          )
        };
        if(route.children){
          route.children.forEach(route=>{
            result.push(
                <Route key={route.key} path={route.path} element={route.element}></Route>
            )
        })
        }
    })
    return result;
}



function App() {
    return (
        <HashRouter>
            <Provider store={store}>
                {/* <Routes>
                    <Route path="/" element={<Layout />}></Route>
                    <Route path="/login" element={<Login />}></Route>
                </Routes> */}
                    <Page />
            </Provider>
        </HashRouter>
    );
}
export default App;
